package Leason3;

import java.util.Arrays;
import java.util.Scanner;

public class Leccture04Task4 {

	public static void main(String[] args) {

		Scanner sc = new Scanner (System.in);

		int[] help = new int [32];
		
		 int dates;
		 int days = 0;
		 int biggest = 0;
		 String daysOff = "";
		 
		 int LuckIdx = 0;
		 int LuckyDay = 0;
		 String seq = "";
		 int index = 1;
		 int idx = 0;
		 
		 System.out.println("How many days you have off on January?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = "January: "; 
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 daysOff += " " + dates;
		 }
		
		 System.out.println("How many days you have off on February?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " February: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 }
		 }
		 System.out.println("How many days you have off on Marth?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " Marth: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 
		 System.out.println("How many days you have off on April?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " April: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 
		 System.out.println("How many days you have off on May?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " May: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on June?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " June: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on July?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " July: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on August?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " August: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on September?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " September: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on Octuber?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " Octuber: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on November?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " November: ";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 System.out.println("How many days you have off on Decembre?");
		 days = sc.nextInt();
		
		 if(days > biggest)
		 {
			 biggest = days;
			 daysOff = " "; 
		 }
		 if (days == biggest)
		 {
			 daysOff += " Decembre:";
		 }
		 for ( int i = 0; i < days; i++)
		 {
			 System.out.println("Which is your " + (i+1) + ". date when you have day off");
			 dates = sc.nextInt();
			 help[dates] += 1;
			 if (days >= biggest){
				 daysOff += " " + dates;
			 	}		 
		 }
		 
		 System.out.println("The most days of you had on " + daysOff + "days");
		 
		 for(int i = 0; i < help.length; i++)
		 {
			 
			 if(help[i] > LuckIdx)
			 {
			 LuckIdx = help[i];
			 LuckyDay = i;
			 }
			 if(help[i] > 0 && (i+1) == index && i>idx)
			 {
				 idx=i;
			 }
			 index++;
		 }
		 System.out.println("The date you had most days off was: " + LuckyDay);
		 System.out.println("The most sequence days you had day off was: " + idx + " days");
	}

}
